import java.util.Scanner;

/**
 * Created by asus on 2017/3/20.
 */
public class chepiao {
    public static void main (String[] args){
        Scanner in = new Scanner(System.in);
        int banlance = 0;
        while (true)
{  
	System.out.print ("请投币：");
        int amount = in.nextInt();
	banlance = banlance + amount;  
        if (banlance >= 10)
{
               System.out.println("****************************");
               System.out.println("*    wangbiao铁路          *");
               System.out.println("*    票价10圆              *");
               System.out.println("****************************");

               System.out.println("找零:" + (banlance - 10));
	       banlance = 0;
}
}
    }
}
